#!/usr/bin/env python
from lib.HandleMysql import *
from lib.handle_mongo import *
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

#mysql - stats
def set_stats_conn():    
    conn = HandleMysql('10.5.20.16','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_online_revenue_stats')
    conn.connect()
    return conn

#mysql - dict
def set_bid_conn():    
    conn = HandleMysql('bidpromotion-s.db.58dns.org','58885','user_houpr_ro','iGpg3REtP@','dbwww58com_bidding_promotion')
    conn.connect()
    return conn

#mysql - dict
def set_dict_conn():    
    conn = HandleMysql('10.5.20.16','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_base_dicts')
    conn.connect()
    return conn
#mysql - open
def set_open_conn():    
    conn = HandleMysql('10.5.20.14','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_groupbuy_open')
    conn.connect()
    return conn

#mysql - open
def set_58_conn():    
    conn = HandleMysql('10.5.20.16','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_58_stats')
    conn.connect()
    return conn

#mysql - infobright
def set_ib_conn():    
    conn = HandleMysql('10.5.20.15','5029','root','group_buytj1140','online_revenue')
    conn.connect()
    return conn
#mysql - ads
def set_ads_conn():    
    conn = HandleMysql('10.5.20.16','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_precision_ads')
    conn.connect()
    return conn
#mysql - zhineng mongo
def set_visit_conn():    
    conn = connect_db(host='bi02.service.58dns.org',db='iadvt_stat')
    return conn

def set_daily_conn():    
    conn = connect_db(host='bi01.service.58dns.org',db='zhineng_ectrlog')
    return conn

#mysql - shop
def set_shop_conn():    
    conn = HandleMysql('10.5.20.16','58885','ec_stat','L#c8UM5RGh5C','dbwww58com_shop_stats')
    conn.connect()
    return conn

#mysql - order
def set_order0_conn():    
    conn = HandleMysql('192.168.12.81','58885','syzn58user_rd','FwE6dfgtpas12t6m','dbwww58com_pay_order_0')
    conn.connect()
    return conn
#mysql - order
def set_order1_conn():    
    conn = HandleMysql('192.168.12.81','58885','syzn58user_rd','FwE6dfgtpas12t6m','dbwww58com_pay_order_1')
    conn.connect()
    return conn
#mysql - order
def set_order2_conn():    
    conn = HandleMysql('192.168.12.81','58886','syzn58user_rd','FwE6dfgtpas12t6m','dbwww58com_pay_order_2')
    conn.connect()
    return conn
#mysql - order
def set_order3_conn():    
    conn = HandleMysql('192.168.12.81','58886','syzn58user_rd','FwE6dfgtpas12t6m','dbwww58com_pay_order_3')
    conn.connect()
    return conn